package com.css.resoft.p2pmonitor.util;

import org.apache.hadoop.hbase.util.Bytes;



public class RowkeyUtil {
	
	public static byte[] getGetRowkey(String orgCode,String dataDate,int index){
		
		byte[] rowkey = new byte[12];
		int days = DateUtil.convert2Day(dataDate, DateUtil.DATE_FORMAT);
		int invert_days = Integer.MAX_VALUE - days;
		
		Bytes.putInt(rowkey,0,orgCode.hashCode());
		Bytes.putInt(rowkey, 4, invert_days);
		Bytes.putInt(rowkey, 8, index);
		
//		String rowkey = orgCode+"_"+dataDate+"_"+index;
		return rowkey;
		
	}
}
